#if($dataTables)
	#set($dataTables.id = ${v.getDataTablesId()})
	#if(!$dataTables.listUrl)#set($dataTables.listUrl = "${request.contextPath}$!{module}/pageList")#end
	#if($dataTables.isDelete&&!$dataTables.deleteUrl)#set($dataTables.deleteUrl = "${request.contextPath}$!{module}/delete")#end
	<div class="row">
		<div class="form-inline">
			<div class="col-sm-12">
				#set($isSearch=false)
				#set($isUpdate = false)
				#set($isAdd = false)
				#foreach($field in $dataTables.fields)
					#if(!$isUpdate&&$field.isUpdate)
		            	#set($isUpdate = true)
		            	#if(!$dataTables.updateUrl)#set($dataTables.updateUrl = "${request.contextPath}$!{module}/update")#end
		            #end
		            #if(!$isAdd&&$field.isAdd)
		            	#set($isAdd = true)
		            	#if(!$dataTables.addUrl)#set($dataTables.addUrl = "${request.contextPath}$!{module}/add")#end
		            #end
					#if($field.isSearch)
						#set($isSearch=true)
						<div buttonUrl="${dataTables.listUrl}">
							<div class="form-group" >
					           <div class="input-group">
						            <span class="input-group-addon">${field.title}</span>
									#if($field.dataSources)
							            <select class="form-control search-field" name="${field.data}" #if($!{field.dataType})dataType="${field.dataType}"#end >
							            	<option value="">请选择</option>
							            	#foreach($dataSource in $field.dataSources)
							            		<option #if($!{field.defaultValue}==${dataSource.value})selected#end value="${dataSource.value}">${dataSource.key}</option>
							            	#end
							            </select>
									#else
							            <input type="text" class="form-control search-field" name="${field.data}" #if($!{field.dataType})dataType="${field.dataType}"#end value="$!{field.defaultValue}">
							        #end
					           </div>
					        </div>
				        </div>
			        #end
		        #end
		        #if($isSearch)
					<button type="button" class="btn btn-primary" id="${dataTables.id}_search" buttonUrl="${dataTables.listUrl}" ><i class="${v.getButtonIcon(${dataTables.listUrl})}" > 查询</i></button>
				#end
				#if($isAdd)
					<button type="button" class="btn btn-success" buttonUrl="${dataTables.addUrl}" data-toggle="modal" data-target="#${dataTables.id}_addModal"><i class="${v.getButtonIcon(${dataTables.addUrl})}"> 新增</i></button>
				#end
			</div>
		</div>
	</div>
	<div class="box">
		<!-- /.box-header -->
		<div class="box-body">
				<div class="col-sm-12">
					<table id="${dataTables.id}" class="table-bordered display" style="width:100%">
					    <thead>
					        <tr>
					        	<th></th>
					        	#foreach($field in $dataTables.fields)
					        		#if($field.isShow)
						            	<th>$field.title</th>
						            #end
					            #end
					            #if($dataTables.isDelete||$isUpdate)
					            	<th>操作</th>
					            #end
					        </tr>
					    </thead>
					</table>
				</div>
		</div>
		<!-- /.box-body -->
	</div>
	#if(${isAdd})
		<div class="modal fade in" id="${dataTables.id}_addModal" style="display: none;">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close">
							<span aria-hidden="true">×</span>
						</button>
						<h4 class="modal-title">添加记录</h4>
					</div>
					<div class="modal-body">
						#foreach($field in $dataTables.fields)
							#if(${field.isAdd})
							<div class="form-group">
					          <label>${field.title}</label>
					          #if($field.dataSources)
					          	<select class="form-control request-param" name="${field.data}" #if(${field.isNeed})isNeed="${field.title}不能为空"#end>
					            	<option value="">请选择</option>
					            	#foreach($dataSource in $field.dataSources)
					            		<option value="${dataSource.value}">${dataSource.key}</option>
					            	#end
					            </select>
					          #else
					          	<input type="text" name="${field.data}" #if($!{field.dataType})dataType="${field.dataType}"#end class="form-control request-param" #if(${field.isNeed})isNeed="${field.title}不能为空"#end>
					          #end
					        </div>
					        #end
						#end
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
						<button type="button" class="btn btn-primary save" buttonUrl="${dataTables.addUrl}">保存</button>
					</div>
				</div>
			</div>
		</div>
	#end
	#if(${isUpdate})
		<div class="modal fade in" id="${dataTables.id}_updateModal" style="display: none;">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close">
							<span aria-hidden="true">×</span>
						</button>
						<h4 class="modal-title">修改记录</h4>
					</div>
					<div class="modal-body">
						#foreach($field in $dataTables.fields)
							<div class="form-group">
					          <label>${field.title}</label>
					          #if($field.dataSources)
					          	<select class="form-control request-param" name="${field.data}" #if(!${field.isUpdate})disabled="disabled"#end #if(${field.isNeed})isNeed="${field.title}不能为空"#end>
					            	<option value="">请选择</option>
					            	#foreach($dataSource in $field.dataSources)
					            		<option value="${dataSource.value}">${dataSource.key}</option>
					            	#end
					            </select>
					          #else
					          	<input type="text" name="${field.data}" #if($!{field.dataType})dataType="${field.dataType}"#end class="form-control request-param" #if(!${field.isUpdate})disabled="disabled"#end  #if(${field.isNeed})isNeed="${field.title}不能为空"#end>
					          #end
					        </div>
						#end
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
						<button type="button" class="btn btn-primary save" buttonUrl="${dataTables.updateUrl}">保存</button>
					</div>
				</div>
			</div>
		</div>
	#end
#end